If one accepts evolution, then one have to consider evolution of the brain as well as the function of the brain. Of course the brain and psychology have been subject to natural selection as well as other organs in our bodies.
Psychology is not only behavior, it is also cognition/emotion and other stuff .